/*
 * @Description: 
 * @Version: 2.0
 * @Autor: ftt
 * @Date: 2022-06-13 10:23:35
 * @LastEditors: TT
 * @LastEditTime: 2022-07-11 17:25:44
 */

import 'package:flutter/material.dart';
import 'package:hzy_normal_widget/hzy_normal_widget.dart';
import 'package:hzy_template/config/dataconfig/language_info_config.dart';
import '../../../components/common_index.dart';
import '../components/login_normal_page.dart';
import '../components/login_widgets.dart';
import '../controllers/login_c.dart';

class LoiginV extends CommonGetXWidget<LoginC> {
  LoiginV({Key? key}) : super(key: key);
  @override
  LoginC get controller => Get.put(LoginC());
  @override
  bool get safeAreabottm => false;
  @override
  bool get safeAreatop => false;
  @override
  bool get resizeToAvoidBottomInset => false;
  @override
  Widget createBody(BuildContext context) {
    List<Widget> list = [
      Gaps.vGap40,
      CommentTools.configlineSpace(
        height: 0.5,
      ),
      createNormalTextField(
        context,
        controller.data[0],
        onchange: (p0) {
          controller.data[0].text = p0;
        },
      ),
      CommentTools.configlineSpace(
        height: 0.5,
      ),
      createNormalTextField(
        context,
        controller.data[1],
        isvisibility: controller.isvisibility.value,
        ontap: () {
          controller.configpasswordtap();
        },
        onchange: (value) {
          controller.changepassword(value);
        },
      ),
      CommentTools.configlineSpace(
        height: 0.5,
      ),
      createerrormsgWidget(
        controller.errormsg.value,
      ),
      Gaps.configvbox(30),
      configLoginBtn(LauchNormalMsg.login, () {
        controller.taplogin();
      }),
      Gaps.vGap10,
      configQuickRegistration(
        context: context,
        ontap: () {
          if (controller.judgeisagreement()) {
            controller.tapquicklogin();
          }
        },
      ),
      createuserargeementWidget(
        controller.agreement.value,
        () {
          controller.tapagreement();
        },
      )
    ];
    return LoginNormalPage(loginchild: list);
  }
}
